<?php
require_once '../config/config.php';
require_once 'Zend/Db.php';

$db = Zend_Db::factory ( 'PDO_MYSQL', $db_config );
//
$sql = ' SELECT * FROM userbk';
$allrecords = $db->fetchAll ( $sql );

//insert1
$insertid = $db->insert ( 'userbk', array ('user_name' => 'Arthur', 'password' => 'sdfs' ) );

//insert2
$sql = "insert into  userbk (`user_name`,`password`)values('sdsd','sdsdsd')";
try {
	$db->query ( $sql );
} catch ( Exception $e ) {
	echo $e->getMessage ();
}
//update
$updateid = $db->update ( 'userbk', array ('user_name' => '11', 'password' => '22' ), 'uid = 42' );

//count
$sql = ' SELECT * FROM userbk where uid>2000 limit 1';
$rowcount = count ( $db->fetchAll ( $sql ) );

$d = '';